﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ElevatorDispatching
{
    public class DoorState : BindableBase
    {
        private bool _isOpen;

        public bool IsOpen { get => _isOpen; set => SetProperty(ref _isOpen, value); }

        public DoorState(bool isOpen)
        {
            IsOpen = isOpen;
        }

        public DoorState() : this(false) { }

        public static implicit operator DoorState(bool isOpen) => new DoorState(isOpen);
        public static explicit operator bool(DoorState state) => state.IsOpen;

        public void Open()
        {
            IsOpen = true;
        }

        public void Close()
        {
            IsOpen = false;
        }
    }
}
